package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SetmealDao {
    /*新增套餐*/
    @Insert("insert into t_setmeal(code,name,helpCode,sex,age,price,remark,attention,img)" +
            "values"+
            " (#{code}, #{name}, #{helpCode}, #{sex}, #{age}, #{price}, #{remark}, #{attention}, #{img}")
    void add(Setmeal setmeal);
    /*编辑套餐*/
    void edit(Setmeal setmeal);
    /*根据id查询套餐*/
    @Select("select * from t_setmeal where id=#{id}")
    Setmeal findById(Long id);
    /*分页查询*/
    Page<Setmeal> pageQuery(QueryPageBean queryPageBean);
}
